home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-12-19 | 79.0 KB | 2,700 lines |
- Newsgroups: comp.sources.unix
- From: hammer@cs.purdue.edu (Adam Hammer)
- Subject: v25i079: rcs-5.6 - Revision Control System, V5.6, Part03/11
- Sender: sources-moderator@pa.dec.com
- Approved: vixie@pa.dec.com
-
- Submitted-By: hammer@cs.purdue.edu (Adam Hammer)
- Posting-Number: Volume 25, Issue 79
- Archive-Name: rcs-5.6/part03
-
- #! /bin/sh
- # This is a shell archive. Remove anything before this line, then unpack
- # it by saving it into a file and typing "sh file". To overwrite existing
- # files, type "sh file -c". You can also feed this as standard input via
- # unshar, or by typing "sh <file", e.g.. If this archive is complete, you
- # will see the following message at the end:
- # "End of archive 3 (of 11)."
- # Contents: COPYING man/ci.1 man/co.1 src/conf.heg src/rcsgen.c
- # Wrapped by vixie@cognition.pa.dec.com on Fri Dec 20 16:23:40 1991
- PATH=/bin:/usr/bin:/usr/ucb ; export PATH
- if test -f 'COPYING' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'COPYING'\"
- else
- echo shar: Extracting \"'COPYING'\" \(17982 characters\)
- sed "s/^X//" >'COPYING' <<'END_OF_FILE'
- X GNU GENERAL PUBLIC LICENSE
- X Version 2, June 1991
- X
- X Copyright (C) 1989, 1991 Free Software Foundation, Inc.
- X 675 Mass Ave, Cambridge, MA 02139, USA
- X Everyone is permitted to copy and distribute verbatim copies
- X of this license document, but changing it is not allowed.
- X
- X Preamble
- X
- X The licenses for most software are designed to take away your
- freedom to share and change it. By contrast, the GNU General Public
- License is intended to guarantee your freedom to share and change free
- software--to make sure the software is free for all its users. This
- General Public License applies to most of the Free Software
- XFoundation's software and to any other program whose authors commit to
- using it. (Some other Free Software Foundation software is covered by
- the GNU Library General Public License instead.) You can apply it to
- your programs, too.
- X
- X When we speak of free software, we are referring to freedom, not
- price. Our General Public Licenses are designed to make sure that you
- have the freedom to distribute copies of free software (and charge for
- this service if you wish), that you receive source code or can get it
- if you want it, that you can change the software or use pieces of it
- in new free programs; and that you know you can do these things.
- X
- X To protect your rights, we need to make restrictions that forbid
- anyone to deny you these rights or to ask you to surrender the rights.
- These restrictions translate to certain responsibilities for you if you
- distribute copies of the software, or if you modify it.
- X
- X For example, if you distribute copies of such a program, whether
- gratis or for a fee, you must give the recipients all the rights that
- you have. You must make sure that they, too, receive or can get the
- source code. And you must show them these terms so they know their
- rights.
- X
- X We protect your rights with two steps: (1) copyright the software, and
- X(2) offer you this license which gives you legal permission to copy,
- distribute and/or modify the software.
- X
- X Also, for each author's protection and ours, we want to make certain
- that everyone understands that there is no warranty for this free
- software. If the software is modified by someone else and passed on, we
- want its recipients to know that what they have is not the original, so
- that any problems introduced by others will not reflect on the original
- authors' reputations.
- X
- X Finally, any free program is threatened constantly by software
- patents. We wish to avoid the danger that redistributors of a free
- program will individually obtain patent licenses, in effect making the
- program proprietary. To prevent this, we have made it clear that any
- patent must be licensed for everyone's free use or not licensed at all.
- X
- X The precise terms and conditions for copying, distribution and
- modification follow.
- X
- X GNU GENERAL PUBLIC LICENSE
- X TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
- X
- X 0. This License applies to any program or other work which contains
- a notice placed by the copyright holder saying it may be distributed
- under the terms of this General Public License. The "Program", below,
- refers to any such program or work, and a "work based on the Program"
- means either the Program or any derivative work under copyright law:
- that is to say, a work containing the Program or a portion of it,
- either verbatim or with modifications and/or translated into another
- language. (Hereinafter, translation is included without limitation in
- the term "modification".) Each licensee is addressed as "you".
- X
- Activities other than copying, distribution and modification are not
- covered by this License; they are outside its scope. The act of
- running the Program is not restricted, and the output from the Program
- is covered only if its contents constitute a work based on the
- Program (independent of having been made by running the Program).
- Whether that is true depends on what the Program does.
- X
- X 1. You may copy and distribute verbatim copies of the Program's
- source code as you receive it, in any medium, provided that you
- conspicuously and appropriately publish on each copy an appropriate
- copyright notice and disclaimer of warranty; keep intact all the
- notices that refer to this License and to the absence of any warranty;
- and give any other recipients of the Program a copy of this License
- along with the Program.
- X
- You may charge a fee for the physical act of transferring a copy, and
- you may at your option offer warranty protection in exchange for a fee.
- X
- X 2. You may modify your copy or copies of the Program or any portion
- of it, thus forming a work based on the Program, and copy and
- distribute such modifications or work under the terms of Section 1
- above, provided that you also meet all of these conditions:
- X
- X a) You must cause the modified files to carry prominent notices
- X stating that you changed the files and the date of any change.
- X
- X b) You must cause any work that you distribute or publish, that in
- X whole or in part contains or is derived from the Program or any
- X part thereof, to be licensed as a whole at no charge to all third
- X parties under the terms of this License.
- X
- X c) If the modified program normally reads commands interactively
- X when run, you must cause it, when started running for such
- X interactive use in the most ordinary way, to print or display an
- X announcement including an appropriate copyright notice and a
- X notice that there is no warranty (or else, saying that you provide
- X a warranty) and that users may redistribute the program under
- X these conditions, and telling the user how to view a copy of this
- X License. (Exception: if the Program itself is interactive but
- X does not normally print such an announcement, your work based on
- X the Program is not required to print an announcement.)
- X
- These requirements apply to the modified work as a whole. If
- identifiable sections of that work are not derived from the Program,
- and can be reasonably considered independent and separate works in
- themselves, then this License, and its terms, do not apply to those
- sections when you distribute them as separate works. But when you
- distribute the same sections as part of a whole which is a work based
- on the Program, the distribution of the whole must be on the terms of
- this License, whose permissions for other licensees extend to the
- entire whole, and thus to each and every part regardless of who wrote it.
- X
- Thus, it is not the intent of this section to claim rights or contest
- your rights to work written entirely by you; rather, the intent is to
- exercise the right to control the distribution of derivative or
- collective works based on the Program.
- X
- In addition, mere aggregation of another work not based on the Program
- with the Program (or with a work based on the Program) on a volume of
- a storage or distribution medium does not bring the other work under
- the scope of this License.
- X
- X 3. You may copy and distribute the Program (or a work based on it,
- under Section 2) in object code or executable form under the terms of
- Sections 1 and 2 above provided that you also do one of the following:
- X
- X a) Accompany it with the complete corresponding machine-readable
- X source code, which must be distributed under the terms of Sections
- X 1 and 2 above on a medium customarily used for software interchange; or,
- X
- X b) Accompany it with a written offer, valid for at least three
- X years, to give any third party, for a charge no more than your
- X cost of physically performing source distribution, a complete
- X machine-readable copy of the corresponding source code, to be
- X distributed under the terms of Sections 1 and 2 above on a medium
- X customarily used for software interchange; or,
- X
- X c) Accompany it with the information you received as to the offer
- X to distribute corresponding source code. (This alternative is
- X allowed only for noncommercial distribution and only if you
- X received the program in object code or executable form with such
- X an offer, in accord with Subsection b above.)
- X
- The source code for a work means the preferred form of the work for
- making modifications to it. For an executable work, complete source
- code means all the source code for all modules it contains, plus any
- associated interface definition files, plus the scripts used to
- control compilation and installation of the executable. However, as a
- special exception, the source code distributed need not include
- anything that is normally distributed (in either source or binary
- form) with the major components (compiler, kernel, and so on) of the
- operating system on which the executable runs, unless that component
- itself accompanies the executable.
- X
- If distribution of executable or object code is made by offering
- access to copy from a designated place, then offering equivalent
- access to copy the source code from the same place counts as
- distribution of the source code, even though third parties are not
- compelled to copy the source along with the object code.
- X
- X 4. You may not copy, modify, sublicense, or distribute the Program
- except as expressly provided under this License. Any attempt
- otherwise to copy, modify, sublicense or distribute the Program is
- void, and will automatically terminate your rights under this License.
- However, parties who have received copies, or rights, from you under
- this License will not have their licenses terminated so long as such
- parties remain in full compliance.
- X
- X 5. You are not required to accept this License, since you have not
- signed it. However, nothing else grants you permission to modify or
- distribute the Program or its derivative works. These actions are
- prohibited by law if you do not accept this License. Therefore, by
- modifying or distributing the Program (or any work based on the
- Program), you indicate your acceptance of this License to do so, and
- all its terms and conditions for copying, distributing or modifying
- the Program or works based on it.
- X
- X 6. Each time you redistribute the Program (or any work based on the
- Program), the recipient automatically receives a license from the
- original licensor to copy, distribute or modify the Program subject to
- these terms and conditions. You may not impose any further
- restrictions on the recipients' exercise of the rights granted herein.
- You are not responsible for enforcing compliance by third parties to
- this License.
- X
- X 7. If, as a consequence of a court judgment or allegation of patent
- infringement or for any other reason (not limited to patent issues),
- conditions are imposed on you (whether by court order, agreement or
- otherwise) that contradict the conditions of this License, they do not
- excuse you from the conditions of this License. If you cannot
- distribute so as to satisfy simultaneously your obligations under this
- License and any other pertinent obligations, then as a consequence you
- may not distribute the Program at all. For example, if a patent
- license would not permit royalty-free redistribution of the Program by
- all those who receive copies directly or indirectly through you, then
- the only way you could satisfy both it and this License would be to
- refrain entirely from distribution of the Program.
- X
- If any portion of this section is held invalid or unenforceable under
- any particular circumstance, the balance of the section is intended to
- apply and the section as a whole is intended to apply in other
- circumstances.
- X
- It is not the purpose of this section to induce you to infringe any
- patents or other property right claims or to contest validity of any
- such claims; this section has the sole purpose of protecting the
- integrity of the free software distribution system, which is
- implemented by public license practices. Many people have made
- generous contributions to the wide range of software distributed
- through that system in reliance on consistent application of that
- system; it is up to the author/donor to decide if he or she is willing
- to distribute software through any other system and a licensee cannot
- impose that choice.
- X
- This section is intended to make thoroughly clear what is believed to
- be a consequence of the rest of this License.
- X
- X 8. If the distribution and/or use of the Program is restricted in
- certain countries either by patents or by copyrighted interfaces, the
- original copyright holder who places the Program under this License
- may add an explicit geographical distribution limitation excluding
- those countries, so that distribution is permitted only in or among
- countries not thus excluded. In such case, this License incorporates
- the limitation as if written in the body of this License.
- X
- X 9. The Free Software Foundation may publish revised and/or new versions
- of the General Public License from time to time. Such new versions will
- be similar in spirit to the present version, but may differ in detail to
- address new problems or concerns.
- X
- XEach version is given a distinguishing version number. If the Program
- specifies a version number of this License which applies to it and "any
- later version", you have the option of following the terms and conditions
- either of that version or of any later version published by the Free
- Software Foundation. If the Program does not specify a version number of
- this License, you may choose any version ever published by the Free Software
- XFoundation.
- X
- X 10. If you wish to incorporate parts of the Program into other free
- programs whose distribution conditions are different, write to the author
- to ask for permission. For software which is copyrighted by the Free
- Software Foundation, write to the Free Software Foundation; we sometimes
- make exceptions for this. Our decision will be guided by the two goals
- of preserving the free status of all derivatives of our free software and
- of promoting the sharing and reuse of software generally.
- X
- X NO WARRANTY
- X
- X 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
- XFOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
- OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
- PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
- OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
- TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
- PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
- REPAIR OR CORRECTION.
- X
- X 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
- WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
- REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
- INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
- OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
- TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
- YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
- PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGES.
- X
- X END OF TERMS AND CONDITIONS
- X
- X Appendix: How to Apply These Terms to Your New Programs
- X
- X If you develop a new program, and you want it to be of the greatest
- possible use to the public, the best way to achieve this is to make it
- free software which everyone can redistribute and change under these terms.
- X
- X To do so, attach the following notices to the program. It is safest
- to attach them to the start of each source file to most effectively
- convey the exclusion of warranty; and each file should have at least
- the "copyright" line and a pointer to where the full notice is found.
- X
- X <one line to give the program's name and a brief idea of what it does.>
- X Copyright (C) 19yy <name of author>
- X
- X This program is free software; you can redistribute it and/or modify
- X it under the terms of the GNU General Public License as published by
- X the Free Software Foundation; either version 2 of the License, or
- X (at your option) any later version.
- X
- X This program is distributed in the hope that it will be useful,
- X but WITHOUT ANY WARRANTY; without even the implied warranty of
- X MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- X GNU General Public License for more details.
- X
- X You should have received a copy of the GNU General Public License
- X along with this program; if not, write to the Free Software
- X Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- X
- Also add information on how to contact you by electronic and paper mail.
- X
- If the program is interactive, make it output a short notice like this
- when it starts in an interactive mode:
- X
- X Gnomovision version 69, Copyright (C) 19yy name of author
- X Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
- X This is free software, and you are welcome to redistribute it
- X under certain conditions; type `show c' for details.
- X
- The hypothetical commands `show w' and `show c' should show the appropriate
- parts of the General Public License. Of course, the commands you use may
- be called something other than `show w' and `show c'; they could even be
- mouse-clicks or menu items--whatever suits your program.
- X
- You should also get your employer (if you work as a programmer) or your
- school, if any, to sign a "copyright disclaimer" for the program, if
- necessary. Here is a sample; alter the names:
- X
- X Yoyodyne, Inc., hereby disclaims all copyright interest in the program
- X `Gnomovision' (which makes passes at compilers) written by James Hacker.
- X
- X <signature of Ty Coon>, 1 April 1989
- X Ty Coon, President of Vice
- X
- This General Public License does not permit incorporating your program into
- proprietary programs. If your program is a subroutine library, you may
- consider it more useful to permit linking proprietary applications with the
- library. If this is what you want to do, use the GNU Library General
- Public License instead of this License.
- END_OF_FILE
- if test 17982 -ne `wc -c <'COPYING'`; then
- echo shar: \"'COPYING'\" unpacked with wrong size!
- fi
- # end of 'COPYING'
- fi
- if test -f 'man/ci.1' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'man/ci.1'\"
- else
- echo shar: Extracting \"'man/ci.1'\" \(17938 characters\)
- sed "s/^X//" >'man/ci.1' <<'END_OF_FILE'
- X.de Id
- X.ds Rv \\$3
- X.ds Dt \\$4
- X..
- X.Id $Id: ci.1,v 5.9 1991/10/07 17:32:46 eggert Exp $
- X.ds r \&\s-1RCS\s0
- X.if n .ds - \%--
- X.if t .ds - \(em
- X.TH CI 1 \*(Dt GNU
- X.SH NAME
- ci \- check in RCS revisions
- X.SH SYNOPSIS
- X.B ci
- X.RI [ options ] " file " .\|.\|.
- X.SH DESCRIPTION
- X.B ci
- stores new revisions into \*r files.
- XEach pathname matching an \*r suffix
- is taken to be an \*r file.
- All others
- are assumed to be working files containing new revisions.
- X.B ci
- deposits the contents of each working file
- into the corresponding \*r file.
- If only a working file is given,
- X.B ci
- tries to find the corresponding \*r file in an \*r subdirectory
- and then in the working file's directory.
- XFor more details, see
- X.SM "FILE NAMING"
- below.
- X.PP
- XFor
- X.B ci
- to work, the caller's login must be on the access list,
- except if the access list is empty or the caller is the superuser or the
- owner of the file.
- To append a new revision to an existing branch, the tip revision on
- that branch must be locked by the caller. Otherwise, only a
- new branch can be created. This restriction is not enforced
- for the owner of the file if non-strict locking is used
- X(see
- X.BR rcs (1)).
- A lock held by someone else may be broken with the
- X.B rcs
- command.
- X.PP
- Unless the
- X.B \-f
- option is given,
- X.B ci
- checks whether the revision to be deposited differs from the preceding one.
- If not, instead of creating a new revision
- X.B ci
- reverts to the preceding one.
- To revert, ordinary
- X.B ci
- removes the working file and any lock;
- X.B "ci\ \-l"
- keeps and
- X.B "ci\ \-u"
- removes any lock, and then they both generate a new working file much as if
- X.B "co\ \-l"
- or
- X.B "co\ \-u"
- had been applied to the preceding revision.
- When reverting, any
- X.B \-n
- and
- X.B \-s
- options apply to the preceding revision.
- X.PP
- XFor each revision deposited,
- X.B ci
- prompts for a log message.
- The log message should summarize the change and must be terminated by
- end-of-file or by a line containing
- X.BR \&. "\ by"
- itself.
- If several files are checked in
- X.B ci
- asks whether to reuse the
- previous log message.
- If the standard input is not a terminal,
- X.B ci
- suppresses the prompt
- and uses the same log message for all files.
- See also
- X.BR \-m .
- X.PP
- If the \*r file does not exist,
- X.B ci
- creates it and
- deposits the contents of the working file as the initial revision
- X(default number:
- X.BR 1.1 ).
- The access list is initialized to empty.
- Instead of the log message,
- X.B ci
- requests descriptive text (see
- X.B \-t
- below).
- X.PP
- The number
- X.I rev
- of the deposited revision can be given by any of the options
- X.BR \-f ,
- X.BR \-I ,
- X.BR \-k ,
- X.BR \-l ,
- X.BR \-M ,
- X.BR \-q ,
- X.BR \-r ,
- or
- X.BR \-u .
- X.I rev
- may be symbolic, numeric, or mixed.
- If
- X.I rev
- is
- X.BR $ ,
- X.B ci
- determines the revision number from keyword values in the working file.
- X.PP
- If
- X.I rev
- is a revision number, it must be higher than the latest
- one on the branch to which
- X.I rev
- belongs, or must start a new branch.
- X.PP
- If
- X.I rev
- is a branch rather than a revision number,
- the new revision is appended to that branch. The level number is obtained
- by incrementing the tip revision number of that branch.
- If
- X.I rev
- indicates a non-existing branch,
- that branch is created with the initial revision numbered
- X.IB rev .1\f1.\fP
- X.br
- X.ne 8
- X.PP
- If
- X.I rev
- is omitted,
- X.B ci
- tries to derive the new revision number from
- the caller's last lock. If the caller has locked the tip revision of a branch,
- the new revision is appended to that branch.
- The new revision number is obtained
- by incrementing the tip revision number.
- If the caller locked a non-tip revision, a new branch is started at
- that revision by incrementing the highest branch number at that revision.
- The default initial branch and level numbers are
- X.BR 1 .
- X.PP
- If
- X.I rev
- is omitted and the caller has no lock, but owns
- the file and locking
- is not set to
- X.IR strict ,
- then the revision is appended to the
- default branch (normally the trunk; see the
- X.B \-b
- option of
- X.BR rcs (1)).
- X.PP
- XException: On the trunk, revisions can be appended to the end, but
- not inserted.
- X.SH OPTIONS
- X.TP
- X.BR \-r [\f2rev\fP]
- checks in a revision, releases the corresponding lock, and
- removes the working file. This is the default.
- X.RS
- X.PP
- The
- X.B \-r
- option has an unusual meaning in
- X.BR ci .
- In other \*r commands,
- X.B \-r
- merely specifies a revision number,
- but in
- X.B ci
- it also releases a lock and removes the working file.
- See
- X.B \-u
- for a tricky example.
- X.RE
- X.TP
- X.BR \-l [\f2rev\fP]
- works like
- X.BR \-r ,
- except it performs an additional
- X.B "co\ \-l"
- for the
- deposited revision. Thus, the deposited revision is immediately
- checked out again and locked.
- This is useful for saving a revision although one wants to continue
- editing it after the checkin.
- X.TP
- X.BR \-u [\f2rev\fP]
- works like
- X.BR \-l ,
- except that the deposited revision is not locked.
- This lets one read the working file
- immediately after checkin.
- X.RS
- X.PP
- The
- X.BR \-l ,
- X.BR \-r ,
- and
- X.B \-u
- options are mutually exclusive and silently override each other.
- XFor example,
- X.B "ci\ \-u\ \-r"
- is equivalent to
- X.B "ci\ \-r"
- because
- X.B \-r
- overrides
- X.BR \-u .
- X.RE
- X.TP
- X.BR \-f [\f2rev\fP]
- forces a deposit; the new revision is deposited even it is not different
- from the preceding one.
- X.TP
- X.BR \-k [\f2rev\fP]
- searches the working file for keyword values to determine its revision number,
- creation date, state, and author (see
- X.BR co (1)),
- and assigns these
- values to the deposited revision, rather than computing them locally.
- It also generates a default login message noting the login of the caller
- and the actual checkin date.
- This option is useful for software distribution. A revision that is sent to
- several sites should be checked in with the
- X.B \-k
- option at these sites to
- preserve the original number, date, author, and state.
- The extracted keyword values and the default log message may be overridden
- with the options
- X.BR \-d ,
- X.BR \-m ,
- X.BR \-s ,
- X.BR \-w ,
- and any option that carries a revision number.
- X.TP
- X.BR \-q [\f2rev\fP]
- quiet mode; diagnostic output is not printed.
- A revision that is not different from the preceding one is not deposited,
- unless
- X.B \-f
- is given.
- X.TP
- X.BR \-I [\f2rev\fP]
- interactive mode;
- the user is prompted and questioned
- even if the standard input is not a terminal.
- X.TP
- X.BR \-d "[\f2date\fP]"
- uses
- X.I date
- for the checkin date and time.
- The
- X.I date
- is specified in free format as explained in
- X.BR co (1).
- This is useful for lying about the checkin date, and for
- X.B \-k
- if no date is available.
- If
- X.I date
- is empty, the working file's time of last modification is used.
- X.TP
- X.BR \-M [\f2rev\fP]
- Set the modification time on any new working file
- to be the date of the retrieved revision.
- XFor example,
- X.BI "ci\ \-d\ \-M\ \-u" "\ f"
- does not alter
- X.IR f 's
- modification time, even if
- X.IR f 's
- contents change due to keyword substitution.
- Use this option with care; it can confuse
- X.BR make (1).
- X.TP
- X.BI \-m "msg"
- uses the string
- X.I msg
- as the log message for all revisions checked in.
- X.TP
- X.BI \-n "name"
- assigns the symbolic name
- X.I name
- to the number of the checked-in revision.
- X.B ci
- prints an error message if
- X.I name
- is already assigned to another
- number.
- X.TP
- X.BI \-N "name"
- same as
- X.BR \-n ,
- except that it overrides a previous assignment of
- X.IR name .
- X.TP
- X.BI \-s "state"
- sets the state of the checked-in revision to the identifier
- X.IR state .
- The default state is
- X.BR Exp .
- X.TP
- X.BI \-t file
- writes descriptive text from the contents of the named
- X.I file
- into the \*r file,
- deleting the existing text.
- The
- X.I file
- may not begin with
- X.BR \- .
- X.TP
- X.BI \-t\- string
- Write descriptive text from the
- X.I string
- into the \*r file, deleting the existing text.
- X.RS
- X.PP
- The
- X.B \-t
- option, in both its forms, has effect only during an initial checkin;
- it is silently ignored otherwise.
- X.PP
- During the initial checkin, if
- X.B \-t
- is not given,
- X.B ci
- obtains the text from standard input,
- terminated by end-of-file or by a line containing
- X.BR \&. "\ by"
- itself.
- The user is prompted for the text if interaction is possible; see
- X.BR \-I .
- X.PP
- XFor backward compatibility with older versions of \*r, a bare
- X.B \-t
- option is ignored.
- X.RE
- X.TP
- X.BI \-w "login"
- uses
- X.I login
- for the author field of the deposited revision.
- Useful for lying about the author, and for
- X.B \-k
- if no author is available.
- X.TP
- X.BI \-V n
- XEmulate \*r version
- X.IR n .
- See
- X.BR co (1)
- for details.
- X.TP
- X.BI \-x "suffixes"
- specifies the suffixes for \*r files.
- A nonempty suffix matches any pathname ending in the suffix.
- An empty suffix matches any pathname of the form
- X.BI RCS/ file
- or
- X.IB path /RCS/ file.
- The
- X.B \-x
- option can specify a list of suffixes
- separated by
- X.BR / .
- XFor example,
- X.B \-x,v/
- specifies two suffixes:
- X.B ,v
- and the empty suffix.
- If two or more suffixes are specified,
- they are tried in order when looking for an \*r file;
- the first one that works is used for that file.
- If no \*r file is found but an \*r file can be created,
- the suffixes are tried in order
- to determine the new \*r file's name.
- The default for
- X.IR suffixes
- is installation-dependent; normally it is
- X.B ,v/
- for hosts like Unix that permit commas in file names,
- and is empty (i.e. just the empty suffix) for other hosts.
- X.SH "FILE NAMING"
- Pairs of \*r files and working files may be specified in three ways
- X(see also the
- example section).
- X.PP
- X1) Both the \*r file and the working file are given. The \*r pathname is of
- the form
- X.IB path1 / workfileX
- and the working pathname is of the form
- X.IB path2 / workfile
- where
- X.IB path1 /
- and
- X.IB path2 /
- are (possibly different or empty) paths,
- X.I workfile
- is a filename, and
- X.I X
- is an \*r suffix.
- If
- X.I X
- is empty,
- X.IB path1 /
- must be
- X.B RCS/
- or must end in
- X.BR /RCS/ .
- X.PP
- X2) Only the \*r file is given. Then the working file is created in the current
- directory and its name is derived from the name of the \*r file
- by removing
- X.IB path1 /
- and the suffix
- X.IR X .
- X.PP
- X3) Only the working file is given.
- Then
- X.B ci
- considers each \*r suffix
- X.I X
- in turn, looking for an \*r file of the form
- X.IB path2 /RCS/ workfileX
- or (if the former is not found and
- X.I X
- is nonempty)
- X.IB path2 / workfileX.
- X.PP
- If the \*r file is specified without a path in 1) and 2),
- X.B ci
- looks for the \*r file first in the directory
- X.B ./RCS
- and then in the current
- directory.
- X.PP
- X.B ci
- reports an error if an attempt to open an \*r file fails for an unusual reason,
- even if the \*r file's pathname is just one of several possibilities.
- XFor example, to suppress use of \*r commands in a directory
- X.IR d ,
- create a regular file named
- X.IB d /RCS
- so that casual attempts to use \*r commands in
- X.I d
- fail because
- X.IB d /RCS
- is not a directory.
- X.SH EXAMPLES
- Suppose
- X.B ,v
- is an \*r suffix and the current directory contains a subdirectory
- X.B RCS
- with an \*r file
- X.BR io.c,v .
- Then each of the following commands check in a copy of
- X.B io.c
- into
- X.B RCS/io.c,v
- as the latest revision, removing
- X.BR io.c .
- X.LP
- X.RS
- X.nf
- X.ft 3
- ci io.c; ci RCS/io.c,v; ci io.c,v;
- ci io.c RCS/io.c,v; ci io.c io.c,v;
- ci RCS/io.c,v io.c; ci io.c,v io.c;
- X.ft
- X.fi
- X.RE
- X.PP
- Suppose instead that the empty suffix
- is an \*r suffix and the current directory contains a subdirectory
- X.B RCS
- with an \*r file
- X.BR io.c .
- The each of the following commands checks in a new revision.
- X.LP
- X.RS
- X.nf
- X.ft 3
- ci io.c; ci RCS/io.c;
- ci io.c RCS/io.c;
- ci RCS/io.c io.c;
- X.ft
- X.fi
- X.RE
- X.SH "FILE MODES"
- An \*r file created by
- X.B ci
- inherits the read and execute permissions
- from the working file. If the \*r file exists already,
- X.B ci
- preserves its read and execute permissions.
- X.B ci
- always turns off all write permissions of \*r files.
- X.SH FILES
- Several temporary files may be created in the directory containing
- the working file, and also in the temporary directory (see
- X.B \s-1TMPDIR\s0
- under
- X.BR \s-1ENVIRONMENT\s0 ).
- A semaphore file or files are created in the directory containing the \*r file.
- With a nonempty suffix, the semaphore names begin with
- the first character of the suffix; therefore, do not specify an suffix
- whose first character could be that of a working filename.
- With an empty suffix, the semaphore names end with
- X.B _
- so working filenames should not end in
- X.BR _ .
- X.PP
- X.B ci
- never changes an \*r or working file.
- Normally,
- X.B ci
- unlinks the file and creates a new one;
- but instead of breaking a chain of one or more symbolic links to an \*r file,
- it unlinks the destination file instead.
- Therefore,
- X.B ci
- breaks any hard or symbolic links to any working file it changes;
- and hard links to \*r files are ineffective,
- but symbolic links to \*r files are preserved.
- X.PP
- The effective user must be able to
- search and write the directory containing the \*r file.
- Normally, the real user must be able to
- read the \*r and working files
- and to search and write the directory containing the working file;
- however, some older hosts
- cannot easily switch between real and effective users,
- so on these hosts the effective user is used for all accesses.
- The effective user is the same as the real user
- unless your copies of
- X.B ci
- and
- X.B co
- have setuid privileges.
- As described in the next section,
- these privileges yield extra security if
- the effective user owns all \*r files and directories,
- and if only the effective user can write \*r directories.
- X.PP
- Users can control access to \*r files by setting the permissions
- of the directory containing the files; only users with write access
- to the directory can use \*r commands to change its \*r files.
- XFor example, in hosts that allow a user to belong to several groups,
- one can make a group's \*r directories writable to that group only.
- This approach suffices for informal projects,
- but it means that any group member can arbitrarily change the group's \*r files,
- and can even remove them entirely.
- Hence more formal projects sometimes distinguish between an \*r administrator,
- who can change the \*r files at will, and other project members,
- who can check in new revisions but cannot otherwise change the \*r files.
- X.SH "SETUID USE"
- To prevent anybody but their \*r administrator from deleting revisions,
- a set of users can employ setuid privileges as follows.
- X.nr n \w'\(bu '+1n-1/1n
- X.IP \(bu \nn
- Check that the host supports \*r setuid use.
- Consult a trustworthy expert if there are any doubts.
- It is best if the
- X.B seteuid()
- system call works as described in Posix 1003.1a Draft 5,
- because \*r can switch back and forth easily
- between real and effective users, even if the real user is
- X.BR root .
- If not, the second best is if the
- X.B setuid()
- system call supports saved setuid
- X(the {\s-1_POSIX_SAVED_IDS\s0} behavior of Posix 1003.1-1990);
- this fails only if the real user is
- X.BR root .
- If \*r detects any failure in setuid, it quits immediately.
- X.IP \(bu \nn
- Choose a user
- X.I A
- to serve as \*r administrator for the set of users.
- Only
- X.I A
- will be able to invoke the
- X.B rcs
- command on the users' \*r files.
- X.I A
- should not be
- X.B root
- or any other user with special powers.
- Mutually suspicious sets of users should use different administrators.
- X.IP \(bu \nn
- Choose a path name
- X.I B
- that will be a directory of files to be executed by the users.
- X.IP \(bu \nn
- Have
- X.I A
- set up
- X.I B
- to contain copies of
- X.B ci
- and
- X.B co
- that are setuid to
- X.I A
- by copying the commands from their standard installation directory
- X.I D
- as follows:
- X.LP
- X.RS
- X.nf
- X.ne 3
- X\f3mkdir\fP \f2B\fP
- X\f3cp\fP \f2D\fP\^\f3/c[io]\fP \f2B\fP
- X\f3chmod go\-w,u+s\fP \f2B\fP\f3/c[io]\fP
- X.fi
- X.RE
- X.IP \(bu \nn
- Have each user prepend
- X.I B
- to their path as follows:
- X.LP
- X.RS
- X.nf
- X.ne 2
- X\f3PATH=\fP\f2B\fP\f3:$PATH; export PATH\fP # ordinary shell
- X\f3set path=(\fP\f2B\fP \f3$path)\fP # C shell
- X.fi
- X.RE
- X.IP \(bu \nn
- Have
- X.I A
- create each \*r directory
- X.I R
- with write access only to
- X.I A
- as follows:
- X.LP
- X.RS
- X.nf
- X.ne 2
- X\f3mkdir\fP \f2R\fP
- X\f3chmod go\-w\fP \f2R\fP
- X.fi
- X.RE
- X.IP \(bu \nn
- If you want to let only certain users read the \*r files,
- put the users into a group
- X.IR G ,
- and have
- X.I A
- further protect the \*r directory as follows:
- X.LP
- X.RS
- X.nf
- X.ne 2
- X\f3chgrp\fP \f2G R\fP
- X\f3chmod g\-w,o\-rwx\fP \f2R\fP
- X.fi
- X.RE
- X.IP \(bu \nn
- Have
- X.I A
- copy old \*r files (if any) into
- X.IR R ,
- to ensure that
- X.I A
- owns them.
- X.IP \(bu \nn
- An \*r file's access list limits who can check in and lock revisions.
- The default access list is empty,
- which grants checkin access to anyone who can read the \*r file.
- If you want limit checkin access,
- have
- X.I A
- invoke
- X.B "rcs\ \-a"
- on the file; see
- X.BR rcs (1).
- In particular,
- X.BI "rcs\ \-e\ \-a" A
- limits access to just
- X.IR A .
- X.IP \(bu \nn
- Have
- X.I A
- initialize any new \*r files with
- X.B "rcs\ \-i"
- before initial checkin, adding the
- X.B \-a
- option if you want to limit checkin access.
- X.IP \(bu \nn
- Give setuid privileges only to
- X.BR ci ,
- X.BR co ,
- and
- X.BR rcsclean ;
- do not give them to
- X.B rcs
- or to any other command.
- X.IP \(bu \nn
- Do not use other setuid commands to invoke \*r commands;
- setuid is trickier than you think!
- X.SH ENVIRONMENT
- X.TP
- X.B \s-1RCSINIT\s0
- options prepended to the argument list, separated by spaces.
- A backslash escapes spaces within an option.
- The
- X.B \s-1RCSINIT\s0
- options are prepended to the argument lists of most \*r commands.
- Useful
- X.B \s-1RCSINIT\s0
- options include
- X.BR \-q ,
- X.BR \-V ,
- and
- X.BR \-x .
- X.TP
- X.B \s-1TMPDIR\s0
- Name of the temporary directory.
- If not set, the environment variables
- X.B \s-1TMP\s0
- and
- X.B \s-1TEMP\s0
- are inspected instead and the first value found is taken;
- if none of them are set,
- a host-dependent default is used, typically
- X.BR /tmp .
- X.SH DIAGNOSTICS
- XFor each revision,
- X.B ci
- prints the \*r file, the working file, and the number
- of both the deposited and the preceding revision.
- The exit status is zero if and only if all operations were successful.
- X.SH IDENTIFICATION
- Author: Walter F. Tichy.
- X.br
- Revision Number: \*(Rv; Release Date: \*(Dt.
- X.br
- Copyright \(co 1982, 1988, 1989 by Walter F. Tichy.
- X.br
- Copyright \(co 1990, 1991 by Paul Eggert.
- X.SH "SEE ALSO"
- co(1), ident(1), make(1), rcs(1), rcsclean(1), rcsdiff(1),
- rcsintro(1), rcsmerge(1), rlog(1), rcsfile(5)
- X.br
- Walter F. Tichy,
- X\*r\*-A System for Version Control,
- X.I "Software\*-Practice & Experience"
- X.BR 15 ,
- X7 (July 1985), 637-654.
- X.br
- END_OF_FILE
- if test 17938 -ne `wc -c <'man/ci.1'`; then
- echo shar: \"'man/ci.1'\" unpacked with wrong size!
- fi
- # end of 'man/ci.1'
- fi
- if test -f 'man/co.1' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'man/co.1'\"
- else
- echo shar: Extracting \"'man/co.1'\" \(13648 characters\)
- sed "s/^X//" >'man/co.1' <<'END_OF_FILE'
- X.de Id
- X.ds Rv \\$3
- X.ds Dt \\$4
- X..
- X.Id $Id: co.1,v 5.7 1991/08/19 03:13:55 eggert Exp $
- X.ds g \&\s-1UTC\s0
- X.ds r \&\s-1RCS\s0
- X.if n .ds - \%--
- X.if t .ds - \(em
- X.TH CO 1 \*(Dt GNU
- X.SH NAME
- co \- check out RCS revisions
- X.SH SYNOPSIS
- X.B co
- X.RI [ options ] " file " .\|.\|.
- X.SH DESCRIPTION
- X.B co
- retrieves a revision from each \*r file and stores it into
- the corresponding working file.
- X.PP
- Pathnames matching an \*r suffix denote \*r files;
- all others denote working files.
- Names are paired as explained in
- X.BR ci (1).
- X.PP
- Revisions of an \*r file may be checked out locked or unlocked. Locking a
- revision prevents overlapping updates. A revision checked out for reading or
- processing (e.g., compiling) need not be locked. A revision checked out
- for editing and later checkin must normally be locked. Checkout with locking
- fails if the revision to be checked out is currently locked by another user.
- X(A lock may be broken with
- X.BR rcs "(1).)\ \&"
- Checkout with locking also requires the caller to be on the access list of
- the \*r file, unless he is the owner of the
- file or the superuser, or the access list is empty.
- Checkout without locking is not subject to accesslist restrictions, and is
- not affected by the presence of locks.
- X.PP
- A revision is selected by options for revision or branch number,
- checkin date/time, author, or state.
- When the selection options
- are applied in combination,
- X.B co
- retrieves the latest revision
- that satisfies all of them.
- If none of the selection options
- is specified,
- X.B co
- retrieves the latest revision
- on the default branch (normally the trunk, see the
- X.B \-b
- option of
- X.BR rcs (1)).
- A revision or branch number may be attached
- to any of the options
- X.BR \-f ,
- X.BR \-I ,
- X.BR \-l ,
- X.BR \-M ,
- X.BR \-p ,
- X.BR \-q ,
- X.BR \-r ,
- or
- X.BR \-u .
- The options
- X.B \-d
- X(date),
- X.B \-s
- X(state), and
- X.B \-w
- X(author)
- retrieve from a single branch, the
- X.I selected
- branch,
- which is either specified by one of
- X.BR \-f,
- X\&.\|.\|.,
- X.BR \-u ,
- or the default branch.
- X.PP
- A
- X.B co
- command applied to an \*r
- file with no revisions creates a zero-length working file.
- X.B co
- always performs keyword substitution (see below).
- X.SH OPTIONS
- X.TP
- X.BR \-r [\f2rev\fP]
- retrieves the latest revision whose number is less than or equal to
- X.I rev.
- If
- X.I rev
- indicates a branch rather than a revision,
- the latest revision on that branch is retrieved.
- If
- X.I rev
- is omitted, the latest revision on the default branch
- X(see the
- X.B \-b
- option of
- X.BR rcs (1))
- is retrieved.
- If
- X.I rev
- is
- X.BR $ ,
- X.B co
- determines the revision number from keyword values in the working file.
- Otherwise, a revision is composed of one or more numeric or symbolic fields
- separated by periods. The numeric equivalent of a symbolic field
- is specified with the
- X.B \-n
- option of the commands
- X.BR ci (1)
- and
- X.BR rcs (1).
- X.TP
- X.BR \-l [\f2rev\fP]
- same as
- X.BR \-r ,
- except that it also locks the retrieved revision for
- the caller.
- X.TP
- X.BR \-u [\f2rev\fP]
- same as
- X.BR \-r ,
- except that it unlocks the retrieved revision if it was
- locked by the caller. If
- X.I rev
- is omitted,
- X.B \-u
- retrieves the revision locked by the caller, if there is one; otherwise,
- it retrieves the latest revision on the default branch.
- X.TP
- X.BR \-f [\f2rev\fP]
- forces the overwriting of the working file;
- useful in connection with
- X.BR \-q .
- See also
- X.SM "FILE MODES"
- below.
- X.TP
- X.B \-kkv
- Generate keyword strings using the default form, e.g.\&
- X.B "$\&Revision: \*(Rv $"
- for the
- X.B Revision
- keyword.
- A locker's name is inserted in the value of the
- X.BR Header ,
- X.BR Id ,
- and
- X.B Locker
- keyword strings
- only as a file is being locked,
- i.e. by
- X.B "ci\ \-l"
- and
- X.BR "co\ \-l".
- This is the default.
- X.TP
- X.B \-kkvl
- Like
- X.BR \-kkv ,
- except that a locker's name is always inserted
- if the given revision is currently locked.
- X.TP
- X.BR \-kk
- Generate only keyword names in keyword strings; omit their values.
- See
- X.SM "KEYWORD SUBSTITUTION"
- below.
- XFor example, for the
- X.B Revision
- keyword, generate the string
- X.B $\&Revision$
- instead of
- X.BR "$\&Revision: \*(Rv $".
- This option is useful to ignore differences due to keyword substitution
- when comparing different revisions of a file.
- X.TP
- X.BR \-ko
- Generate the old keyword string,
- present in the working file just before it was checked in.
- XFor example, for the
- X.B Revision
- keyword, generate the string
- X.B "$\&Revision: 1.1 $"
- instead of
- X.B "$\&Revision: \*(Rv $"
- if that is how the string appeared when the file was checked in.
- This can be useful for binary file formats
- that cannot tolerate any changes to substrings
- that happen to take the form of keyword strings.
- X.TP
- X.BR \-kv
- Generate only keyword values for keyword strings.
- XFor example, for the
- X.B Revision
- keyword, generate the string
- X.B \*(Rv
- instead of
- X.BR "$\&Revision: \*(Rv $".
- This can help generate files in programming languages where it is hard to
- strip keyword delimiters like
- X.B "$\&Revision:\ $"
- from a string.
- However, further keyword substitution cannot be performed once the
- keyword names are removed, so this option should be used with care.
- Because of this danger of losing keywords,
- this option cannot be combined with
- X.BR \-l ,
- and the owner write permission of the working file is turned off;
- to edit the file later, check it out again without
- X.BR \-kv .
- X.TP
- X.BR \-p [\f2rev\fP]
- prints the retrieved revision on the standard output rather than storing it
- in the working file.
- This option is useful when
- X.B co
- is part of a pipe.
- X.TP
- X.BR \-q [\f2rev\fP]
- quiet mode; diagnostics are not printed.
- X.TP
- X.BR \-I [\f2rev\fP]
- interactive mode;
- the user is prompted and questioned
- even if the standard input is not a terminal.
- X.TP
- X.BI \-d date
- retrieves the latest revision on the selected branch whose checkin date/time is
- less than or equal to
- X.I date.
- The date and time may be given in free format.
- The time zone
- X.B LT
- stands for local time;
- other common time zone names are understood.
- XFor example, the following
- X.IR date s
- are equivalent
- if local time is January 11, 1990, 8pm Pacific Standard Time,
- eight hours west of Coordinated Universal Time (\*g):
- X.RS
- X.LP
- X.RS
- X.nf
- X.ta \w'\f3Thu, 11 Jan 1990 20:00:00 \-0800\fP 'u
- X.ne 9
- X\f38:00 pm lt\fP
- X\f34:00 AM, Jan. 12, 1990\fP note: default is \*g
- X\f31990/01/12 04:00:00\fP \*r date format
- X\f3Thu Jan 11 20:00:00 1990 LT\fP output of \f3ctime\fP(3) + \f3LT\fP
- X\f3Thu Jan 11 20:00:00 PST 1990\fP output of \f3date\fP(1)
- X\f3Fri Jan 12 04:00:00 GMT 1990\fP
- X\f3Thu, 11 Jan 1990 20:00:00 \-0800\fP
- X\f3Fri-JST, 1990, 1pm Jan 12\fP
- X\f312-January-1990, 04:00-WET\fP
- X.ta 4n +4n +4n +4n
- X.fi
- X.RE
- X.LP
- Most fields in the date and time may be defaulted.
- The default time zone is \*g.
- The other defaults are determined in the order year, month, day,
- hour, minute, and second (most to least significant). At least one of these
- fields must be provided. For omitted fields that are of higher significance
- than the highest provided field, the time zone's current values are assumed.
- XFor all other omitted fields,
- the lowest possible values are assumed.
- XFor example, the date
- X.B "20, 10:30"
- defaults to
- X10:30:00 \*g of the 20th of the \*g time zone's current month and year.
- The date/time must be quoted if it contains spaces.
- X.RE
- X.TP
- X.BR \-M [\f2rev\fP]
- Set the modification time on the new working file
- to be the date of the retrieved revision.
- Use this option with care; it can confuse
- X.BR make (1).
- X.TP
- X.BI \-s state
- retrieves the latest revision on the selected branch whose state is set to
- X.I state.
- X.TP
- X.BR \-w [\f2login\fP]
- retrieves the latest revision on the selected branch which was checked in
- by the user with login name
- X.I login.
- If the argument
- X.I login
- is
- omitted, the caller's login is assumed.
- X.TP
- X.BI \-j joinlist
- generates a new revision which is the join of the revisions on
- X.I joinlist.
- This option is largely obsoleted by
- X.BR rcsmerge (1)
- but is retained for backwards compatibility.
- X.RS
- X.PP
- The
- X.I joinlist
- is a comma-separated list of pairs of the form
- X.IB rev2 : rev3,
- where
- X.I rev2
- and
- X.I rev3
- are (symbolic or numeric)
- revision numbers.
- XFor the initial such pair,
- X.I rev1
- denotes the revision selected
- by the above options
- X.BR \-f,
- X\&.\|.\|.,
- X.BR \-w .
- XFor all other pairs,
- X.I rev1
- denotes the revision generated by the previous pair.
- X(Thus, the output
- of one join becomes the input to the next.)
- X.PP
- XFor each pair,
- X.B co
- joins revisions
- X.I rev1
- and
- X.I rev3
- with respect to
- X.I rev2.
- This means that all changes that transform
- X.I rev2
- into
- X.I rev1
- are applied to a copy of
- X.I rev3.
- This is particularly useful if
- X.I rev1
- and
- X.I rev3
- are the ends of two branches that have
- X.I rev2
- as a common ancestor. If
- X.IR rev1 < rev2 < rev3
- on the same branch,
- joining generates a new revision which is like
- X.I rev3,
- but with all changes that lead from
- X.I rev1
- to
- X.I rev2
- undone.
- If changes from
- X.I rev2
- to
- X.I rev1
- overlap with changes from
- X.I rev2
- to
- X.I rev3,
- X.B co
- reports overlaps as described in
- X.BR merge (1).
- X.PP
- XFor the initial pair,
- X.I rev2
- may be omitted. The default is the common
- ancestor.
- If any of the arguments indicate branches, the latest revisions
- on those branches are assumed.
- The options
- X.B \-l
- and
- X.B \-u
- lock or unlock
- X.I rev1.
- X.RE
- X.TP
- X.BI \-V n
- XEmulate \*r version
- X.I n,
- where
- X.I n
- may be
- X.BR 3 ,
- X.BR 4 ,
- or
- X.BR 5 .
- This may be useful when interchanging \*r files with others who are
- running older versions of \*r.
- To see which version of \*r your correspondents are running, have them invoke
- X.B rlog
- on an \*r file;
- if none of the first few lines of output contain the string
- X.B branch:
- it is version 3;
- if the dates' years have just two digits, it is version 4;
- otherwise, it is version 5.
- An \*r file generated while emulating version 3 will lose its default branch.
- An \*r revision generated while emulating version 4 or earlier will have
- a timestamp that is off by up to 13 hours.
- A revision extracted while emulating version 4 or earlier will contain
- dates of the form
- X.IB yy / mm / dd
- instead of
- X.IB yyyy / mm / dd
- and may also contain different white space in the substitution for
- X.BR $\&Log$ .
- X.TP
- X.BI \-x "suffixes"
- Use
- X.I suffixes
- to characterize \*r files.
- See
- X.BR ci (1)
- for details.
- X.SH "KEYWORD SUBSTITUTION"
- Strings of the form
- X.BI $ keyword $
- and
- X.BI $ keyword : .\|.\|. $
- embedded in
- the text are replaced
- with strings of the form
- X.BI $ keyword : value $
- where
- X.I keyword
- and
- X.I value
- are pairs listed below.
- Keywords may be embedded in literal strings
- or comments to identify a revision.
- X.PP
- Initially, the user enters strings of the form
- X.BI $ keyword $ .
- On checkout,
- X.B co
- replaces these strings with strings of the form
- X.BI $ keyword : value $ .
- If a revision containing strings of the latter form
- is checked back in, the value fields will be replaced during the next
- checkout.
- Thus, the keyword values are automatically updated on checkout.
- This automatic substitution can be modified by the
- X.B \-k
- options.
- X.PP
- Keywords and their corresponding values:
- X.TP
- X.B $\&Author$
- The login name of the user who checked in the revision.
- X.TP
- X.B $\&Date$
- The date and time (\*g) the revision was checked in.
- X.TP
- X.B $\&Header$
- A standard header containing the full pathname of the \*r file, the
- revision number, the date (\*g), the author, the state,
- and the locker (if locked).
- X.TP
- X.B $\&Id$
- Same as
- X.BR $\&Header$ ,
- except that the \*r filename is without a path.
- X.TP
- X.B $\&Locker$
- The login name of the user who locked the revision (empty if not locked).
- X.TP
- X.B $\&Log$
- The log message supplied during checkin, preceded by a header
- containing the \*r filename, the revision number, the author, and the date
- X(\*g).
- XExisting log messages are
- X.I not
- replaced.
- Instead, the new log message is inserted after
- X.BR $\&Log: .\|.\|. $ .
- This is useful for
- accumulating a complete change log in a source file.
- X.TP
- X.B $\&RCSfile$
- The name of the \*r file without a path.
- X.TP
- X.B $\&Revision$
- The revision number assigned to the revision.
- X.TP
- X.B $\&Source$
- The full pathname of the \*r file.
- X.TP
- X.B $\&State$
- The state assigned to the revision with the
- X.B \-s
- option of
- X.BR rcs (1)
- or
- X.BR ci (1).
- X.SH "FILE MODES"
- The working file inherits the read and execute permissions from the \*r
- file. In addition, the owner write permission is turned on, unless
- X.B \-kv
- is set or the file
- is checked out unlocked and locking is set to strict (see
- X.BR rcs (1)).
- X.PP
- If a file with the name of the working file exists already and has write
- permission,
- X.B co
- aborts the checkout,
- asking beforehand if possible.
- If the existing working file is
- not writable or
- X.B \-f
- is given, the working file is deleted without asking.
- X.SH FILES
- X.B co
- accesses files much as
- X.BR ci (1)
- does, except that it does not need to read the working file.
- X.SH ENVIRONMENT
- X.TP
- X.B \s-1RCSINIT\s0
- options prepended to the argument list, separated by spaces.
- See
- X.BR ci (1)
- for details.
- X.SH DIAGNOSTICS
- The \*r pathname, the working pathname,
- and the revision number retrieved are
- written to the diagnostic output.
- The exit status is zero if and only if all operations were successful.
- X.SH IDENTIFICATION
- Author: Walter F. Tichy.
- X.br
- Revision Number: \*(Rv; Release Date: \*(Dt.
- X.br
- Copyright \(co 1982, 1988, 1989 by Walter F. Tichy.
- X.br
- Copyright \(co 1990, 1991 by Paul Eggert.
- X.SH "SEE ALSO"
- ci(1), ctime(3), date(1), ident(1), make(1),
- rcs(1), rcsdiff(1), rcsintro(1), rcsmerge(1), rlog(1),
- rcsfile(5)
- X.br
- Walter F. Tichy,
- X\*r\*-A System for Version Control,
- X.I "Software\*-Practice & Experience"
- X.BR 15 ,
- X7 (July 1985), 637-654.
- X.SH LIMITS
- Links to the \*r and working files are not preserved.
- X.PP
- There is no way to selectively suppress the expansion of keywords, except
- by writing them differently. In nroff and troff, this is done by embedding the
- null-character
- X.B \e&
- into the keyword.
- X.SH BUGS
- The
- X.B \-d
- option sometimes gets confused, and accepts no date before 1970.
- X.br
- END_OF_FILE
- if test 13648 -ne `wc -c <'man/co.1'`; then
- echo shar: \"'man/co.1'\" unpacked with wrong size!
- fi
- # end of 'man/co.1'
- fi
- if test -f 'src/conf.heg' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'src/conf.heg'\"
- else
- echo shar: Extracting \"'src/conf.heg'\" \(14899 characters\)
- sed "s/^X//" >'src/conf.heg' <<'END_OF_FILE'
- X/* example RCS compile-time configuration */
- X
- X /* $Id: conf.heg,v 1.8 1991/11/20 18:21:09 eggert Exp $ */
- X
- X/*
- X * This example RCS compile-time configuration describes a host that conforms
- X * to Standard C (1990) and Posix 1003.1-1990 and has GNU diff.
- X * If you can't get conf.sh to work as described in the Makefile,
- X * copy this file to conf.h and edit conf.h by hand; see README.
- X */
- X
- X#define exitmain(n) return n /* how to exit from main() */
- X/* #define _POSIX_SOURCE */ /* Define this if Posix + strict Standard C. */
- X
- X#include <errno.h>
- X#include <stdio.h>
- X#include <time.h>
- X
- X/* Comment out #include lines below that do not work. */
- X#include <sys/types.h>
- X#include <sys/stat.h>
- X#include <dirent.h>
- X#include <fcntl.h>
- X#include <limits.h>
- X#include <pwd.h>
- X#include <signal.h>
- X#include <stdlib.h>
- X#include <string.h>
- X/* #include <sys/mman.h> */
- X#include <sys/wait.h>
- X#include <unistd.h>
- X#include <utime.h>
- X/* #include <vfork.h> */
- X
- X/* Define the following symbols to be 1 or 0. */
- X#define has_sys_dir_h 0 /* Does #include <sys/dir.h> work? */
- X#define has_sys_param_h 0 /* Does #include <sys/param.h> work? */
- X#define has_readlink 0 /* Does readlink() work? */
- X
- X/* #undef NAME_MAX */ /* Uncomment this if NAME_MAX is broken. */
- X
- X#if !defined(NAME_MAX) && !defined(_POSIX_NAME_MAX)
- X# if has_sys_dir_h
- X# include <sys/dir.h>
- X# endif
- X# ifndef NAME_MAX
- X# ifndef MAXNAMLEN
- X# define MAXNAMLEN 14
- X# endif
- X# define NAME_MAX MAXNAMLEN
- X# endif
- X#endif
- X#if !defined(PATH_MAX) && !defined(_POSIX_PATH_MAX)
- X# if has_sys_param_h
- X# include <sys/param.h>
- X# define included_sys_param_h 1
- X# endif
- X# ifndef PATH_MAX
- X# ifndef MAXPATHLEN
- X# define MAXPATHLEN 1024
- X# endif
- X# define PATH_MAX (MAXPATHLEN-1)
- X# endif
- X#endif
- X#if has_readlink && !defined(MAXSYMLINKS)
- X# if has_sys_param_h && !included_sys_param_h
- X# include <sys/param.h>
- X# endif
- X# ifndef MAXSYMLINKS
- X# define MAXSYMLINKS 20 /* BSD; not standard yet */
- X# endif
- X#endif
- X
- X/* Comment out the keyword definitions below if the keywords work. */
- X/* #define const */
- X/* #define volatile */
- X
- X/* Comment out the typedefs below if the types are already declared. */
- X/* Fix any uncommented typedefs that are wrong. */
- X/* typedef int mode_t; */
- X/* typedef int pid_t; */
- X/* typedef int sig_atomic_t; */
- X/* typedef unsigned size_t; */
- X/* typedef int ssize_t; */
- X/* typedef long time_t; */
- X/* typedef int uid_t; */
- X
- X/* Define the following symbols to be 1 or 0. */
- X#define has_prototypes 1 /* Do function prototypes work? */
- X#define has_stdarg 1 /* Does <stdarg.h> work? */
- X#define has_varargs 0 /* Does <varargs.h> work? */
- X#define va_start_args 2 /* How many args does va_start() take? */
- X#if has_prototypes
- X# define P(params) params
- X#else
- X# define P(params) ()
- X#endif
- X#if has_stdarg
- X# include <stdarg.h>
- X#else
- X# if has_varargs
- X# include <varargs.h>
- X# else
- X typedef char *va_list;
- X# define va_dcl int va_alist;
- X# define va_start(ap) ((ap) = (va_list)&va_alist)
- X# define va_arg(ap,t) (((t*) ((ap)+=sizeof(t))) [-1])
- X# define va_end(ap)
- X# endif
- X#endif
- X#if va_start_args == 2
- X# define vararg_start va_start
- X#else
- X# define vararg_start(ap,p) va_start(ap)
- X#endif
- X
- X#define text_equals_binary_stdio 1 /* Does stdio treat text like binary? */
- X#define text_work_stdio 0 /* Text i/o for working file, binary for RCS file? */
- X#if text_equals_binary_stdio
- X /* Text and binary i/o behave the same, or binary i/o does not work. */
- X# define FOPEN_R "r"
- X# define FOPEN_W "w"
- X# define FOPEN_WPLUS "w+"
- X#else
- X /* Text and binary i/o behave differently. */
- X /* This is incompatible with Posix and Unix. */
- X# define FOPEN_R "rb"
- X# define FOPEN_W "wb"
- X# define FOPEN_WPLUS "w+b"
- X#endif
- X#if text_work_stdio
- X# define FOPEN_R_WORK "r"
- X# define FOPEN_W_WORK "w"
- X# define FOPEN_WPLUS_WORK "w+"
- X#else
- X# define FOPEN_R_WORK FOPEN_R
- X# define FOPEN_W_WORK FOPEN_W
- X# define FOPEN_WPLUS_WORK FOPEN_WPLUS
- X#endif
- X
- X/* Define or comment out the following symbols as needed. */
- X#define bad_fopen_wplus 0 /* Does fopen(f,FOPEN_WPLUS) fail to truncate f? */
- X#define getlogin_is_secure 0 /* Is getlogin() secure? Usually it's not. */
- X#define has_dirent 1 /* Do opendir(), readdir(), closedir() work? */
- X#define has_fchmod 0 /* Does fchmod() work? */
- X#define has_fputs 1 /* Does fputs() work? */
- X#define has_ftruncate 0 /* Does ftruncate() work? */
- X#define has_getuid 1 /* Does getuid() work? */
- X#define has_getpwuid 1 /* Does getpwuid() work? */
- X#define has_link 1 /* Does link() work? */
- X#define has_memcmp 1 /* Does memcmp() work? */
- X#define has_memcpy 1 /* Does memcpy() work? */
- X#define has_memmove 1 /* Does memmove() work? */
- X#define has_madvise 0 /* Does madvise() work? */
- X#define has_mmap 0 /* Does mmap() work on regular files? */
- X#define has_rename 1 /* Does rename() work? */
- X#define bad_a_rename 0 /* Does rename(A,B) fail if A is unwritable? */
- X#define bad_b_rename 0 /* Does rename(A,B) fail if B is unwritable? */
- X#define VOID (void) /* 'VOID e;' discards the value of an expression 'e'. */
- X#define has_seteuid 0 /* Does seteuid() work? See README. */
- X#define has_setuid 1 /* Does setuid() exist? */
- X#define has_signal 1 /* Does signal() work? */
- X#define signal_args P((int)) /* arguments of signal handlers */
- X#define signal_type void /* type returned by signal handlers */
- X#define sig_zaps_handler 0 /* Must a signal handler reinvoke signal()? */
- X#define has_sigaction 1 /* Does struct sigaction work? */
- X#define has_sigblock 0 /* Does sigblock() work? */
- X/* #define sigmask(s) (1 << ((s)-1)) */ /* Yield mask for signal number. */
- X#define has_sys_siglist 0 /* Does sys_siglist[] work? */
- typedef ssize_t fread_type; /* type returned by fread() and fwrite() */
- typedef size_t freadarg_type; /* type of their size arguments */
- typedef void *malloc_type; /* type returned by malloc() */
- X#define has_getcwd 1 /* Does getcwd() work? */
- X#define has_getwd 0 /* Does getwd() work? */
- X#define has_mktemp 0 /* Does mktemp() work? */
- X#define has_NFS 0 /* Might NFS be used? */
- X/* #define strchr index */ /* Use old-fashioned name for strchr()? */
- X/* #define strrchr rindex */ /* Use old-fashioned name for strrchr()? */
- X#define bad_unlink 0 /* Does unlink() fail on unwritable files? */
- X#define has_vfork 0 /* Does vfork() work? */
- X#define has_fork 1 /* Does fork() work? */
- X#define has_spawn 0 /* Does spawn*() work? */
- X#define has_wait 1 /* Does wait() work? */
- X#define has_waitpid 1 /* Does waitpid() work? */
- X#define RCS_SHELL "/bin/sh" /* shell to run RCS subprograms */
- X#define has_vfprintf 1 /* Does vfprintf() work? */
- X#define has__doprintf 0 /* Does _doprintf() work? */
- X#define has__doprnt 0 /* Does _doprnt() work? */
- X/* #undef EXIT_FAILURE */ /* Uncomment this if EXIT_FAILURE is broken. */
- X#define large_memory 0 /* Can main memory hold entire RCS files? */
- X/* #undef ULONG_MAX */ /* Uncomment this if ULONG_MAX is broken (e.g. < 0). */
- X/* struct utimbuf { time_t actime, modtime; }; */ /* Uncomment this if needed. */
- X#define CO "/usr/local/bin/co" /* name of 'co' program */
- X#define COMPAT2 0 /* Are version 2 files supported? */
- X#define DATEFORM "%.2d.%.2d.%.2d.%.2d.%.2d.%.2d" /* e.g. 01.01.01.01.01.01 */
- X#define DIFF "/usr/local/bin/diff" /* name of 'diff' program */
- X#define DIFF3 "/usr/local/bin/diff3" /* name of 'diff3' program */
- X#define DIFF3_BIN 1 /* Is diff3 user-visible (not the /usr/lib auxiliary)? */
- X#define DIFF_FLAGS , "-an" /* Make diff output suitable for RCS. */
- X#define DIFF_L 1 /* Does diff -L work? */
- X#define DIFF_SUCCESS 0 /* DIFF status if no differences are found */
- X#define DIFF_FAILURE 1 /* DIFF status if differences are found */
- X#define DIFF_TROUBLE 2 /* DIFF status if trouble */
- X#define ED "/bin/ed" /* name of 'ed' program (used only if !DIFF3_BIN) */
- X#define MERGE "/usr/local/bin/merge" /* name of 'merge' program */
- X#define TMPDIR "/tmp" /* default directory for temporary files */
- X#define SLASH '/' /* principal pathname separator */
- X#define SLASHes '/' /* `case SLASHes:' labels all pathname separators */
- X#define isSLASH(c) ((c) == SLASH) /* Is arg a pathname separator? */
- X#define ROOTPATH(p) isSLASH((p)[0]) /* Is p an absolute pathname? */
- X#define X_DEFAULT ",v/" /* default value for -x option */
- X#define DIFF_ABSOLUTE 1 /* Is ROOTPATH(DIFF) true? */
- X#define ALL_ABSOLUTE 1 /* Are all subprograms absolute pathnames? */
- X#define SENDMAIL "/bin/mail" /* how to send mail */
- X#define TZ_must_be_set 0 /* Must TZ be set for gmtime() to work? */
- X
- X
- X
- X/* Adjust the following declarations as needed. */
- X
- X
- X#if __GNUC__ && !__STRICT_ANSI__
- X# define exiting volatile /* GCC extension: function cannot return */
- X#else
- X# define exiting
- X#endif
- X
- X#if has_ftruncate
- X int ftruncate P((int,off_t));
- X#endif
- X
- X/* <sys/mman.h> */
- X#if has_madvise
- X int madvise P((caddr_t,size_t,int));
- X#endif
- X#if has_mmap
- X caddr_t mmap P((caddr_t,size_t,int,int,int,off_t));
- X int munmap P((caddr_t,size_t));
- X#endif
- X
- X
- X/* Posix (ISO/IEC 9945-1: 1990 / IEEE Std 1003.1-1990) */
- X/* These definitions are for the benefit of non-Posix hosts, and */
- X/* Posix hosts that have Standard C compilers but traditional include files. */
- X/* Unfortunately, mixed-up hosts are all too common. */
- X
- X/* <fcntl.h> */
- X#ifdef F_DUPFD
- X int fcntl P((int,int,...));
- X#else
- X int dup2 P((int,int));
- X#endif
- X#ifndef O_BINARY /* some non-Posix hosts need O_BINARY */
- X# define O_BINARY 0 /* no effect on Posix */
- X#endif
- X#ifdef O_CREAT
- X# define open_can_creat 1
- X#else
- X# define open_can_creat 0
- X# define O_RDONLY 0
- X# define O_WRONLY 1
- X# define O_RDWR 2
- X# define O_CREAT 01000
- X# define O_TRUNC 02000
- X int creat P((char const*,mode_t));
- X#endif
- X#ifndef O_EXCL
- X# define O_EXCL 0
- X#endif
- X
- X/* <pwd.h> */
- X#if has_getpwuid
- X struct passwd *getpwuid P((uid_t));
- X#endif
- X
- X/* <signal.h> */
- X#if has_sigaction
- X int sigaction P((int,struct sigaction const*,struct sigaction*));
- X int sigaddset P((sigset_t*,int));
- X int sigemptyset P((sigset_t*));
- X#else
- X#if has_sigblock
- X /* BSD */
- X int sigblock P((int));
- X int sigmask P((int));
- X int sigsetmask P((int));
- X#endif
- X#endif
- X
- X/* <stdio.h> */
- XFILE *fdopen P((int,char const*));
- int fileno P((FILE*));
- X
- X/* <sys/stat.h> */
- int chmod P((char const*,mode_t));
- int fstat P((int,struct stat*));
- int stat P((char const*,struct stat*));
- mode_t umask P((mode_t));
- X#if has_fchmod
- X int fchmod P((int,mode_t));
- X#endif
- X#ifndef S_IRUSR
- X# ifdef S_IREAD
- X# define S_IRUSR S_IREAD
- X# else
- X# define S_IRUSR 0400
- X# endif
- X# ifdef S_IWRITE
- X# define S_IWUSR S_IWRITE
- X# else
- X# define S_IWUSR (S_IRUSR/2)
- X# endif
- X#endif
- X#ifndef S_IRGRP
- X# if has_getuid
- X# define S_IRGRP (S_IRUSR / 0010)
- X# define S_IWGRP (S_IWUSR / 0010)
- X# define S_IROTH (S_IRUSR / 0100)
- X# define S_IWOTH (S_IWUSR / 0100)
- X# else
- X /* single user OS -- not Posix or Unix */
- X# define S_IRGRP 0
- X# define S_IWGRP 0
- X# define S_IROTH 0
- X# define S_IWOTH 0
- X# endif
- X#endif
- X#ifndef S_ISREG
- X# define S_ISREG(n) (((n) & S_IFMT) == S_IFREG)
- X#endif
- X
- X/* <sys/wait.h> */
- X#if has_wait
- X pid_t wait P((int*));
- X#endif
- X#ifndef WEXITSTATUS
- X# define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
- X# undef WIFEXITED /* Avoid 4.3BSD incompatibility with Posix. */
- X#endif
- X#ifndef WIFEXITED
- X# define WIFEXITED(stat_val) (!((stat_val) & 255))
- X#endif
- X
- X/* <unistd.h> */
- char *getlogin P((void));
- int close P((int));
- int isatty P((int));
- int link P((char const*,char const*));
- int open P((char const*,int,...));
- int unlink P((char const*));
- X/* int _filbuf P((FILE*)); *//* keeps lint quiet in traditional C */
- X/* int _flsbuf P((int,FILE*)); *//* keeps lint quiet in traditional C */
- long pathconf P((char const*,int));
- ssize_t write P((int,void const*,size_t));
- X#ifndef STDIN_FILENO
- X# define STDIN_FILENO 0
- X# define STDOUT_FILENO 1
- X# define STDERR_FILENO 2
- X#endif
- X#if has_fork
- X# if !has_vfork
- X# undef vfork
- X# define vfork fork
- X# endif
- X pid_t vfork P((void)); /* vfork is nonstandard but faster */
- X#endif
- X#if has_getcwd || !has_getwd
- X char *getcwd P((char*,size_t));
- X#else
- X char *getwd P((char*));
- X#endif
- X#if has_getuid
- X uid_t getuid P((void));
- X#endif
- X#if has_readlink
- X ssize_t readlink P((char const*,char*,size_t)); /* BSD; not standard yet */
- X#endif
- X#if has_setuid
- X# if !has_seteuid
- X# undef seteuid
- X# define seteuid setuid
- X# endif
- X int seteuid P((uid_t));
- X uid_t geteuid P((void));
- X#endif
- X#if has_spawn
- X int spawnv P((int,char const*,char*const*));
- X# if ALL_ABSOLUTE
- X# define spawn_RCS spawnv
- X# else
- X# define spawn_RCS spawnvp
- X int spawnvp P((int,char const*,char*const*));
- X# endif
- X#else
- X int execv P((char const*,char*const*));
- X# if ALL_ABSOLUTE
- X# define exec_RCS execv
- X# else
- X# define exec_RCS execvp
- X int execvp P((char const*,char*const*));
- X# endif
- X#endif
- X
- X/* utime.h */
- int utime P((char const*,struct utimbuf const*));
- X
- X
- X/* Standard C library */
- X/* These definitions are for the benefit of hosts that have */
- X/* traditional C include files, possibly with Standard C compilers. */
- X/* Unfortunately, mixed-up hosts are all too common. */
- X
- X/* <errno.h> */
- extern int errno;
- X
- X/* <limits.h> */
- X#ifndef ULONG_MAX
- X /* This does not work in #ifs, but it's good enough for us. */
- X# define ULONG_MAX ((unsigned long)-1)
- X#endif
- X
- X/* <signal.h> */
- X#if has_signal
- X signal_type (*signal P((int,signal_type(*)signal_args)))signal_args;
- X#endif
- X
- X/* <stdio.h> */
- XFILE *fopen P((char const*,char const*));
- fread_type fread P((void*,freadarg_type,freadarg_type,FILE*));
- fread_type fwrite P((void const*,freadarg_type,freadarg_type,FILE*));
- int fclose P((FILE*));
- int feof P((FILE*));
- int ferror P((FILE*));
- int fflush P((FILE*));
- int fprintf P((FILE*,char const*,...));
- int fputs P((char const*,FILE*));
- int fseek P((FILE*,long,int));
- int printf P((char const*,...));
- int rename P((char const*,char const*));
- int sprintf P((char*,char const*,...));
- long ftell P((FILE*));
- void clearerr P((FILE*));
- void perror P((char const*));
- X#ifndef L_tmpnam
- X# define L_tmpnam 32 /* power of 2 > sizeof("/usr/tmp/xxxxxxxxxxxxxxx") */
- X#endif
- X#ifndef SEEK_SET
- X# define SEEK_SET 0
- X#endif
- X#if has_mktemp
- X char *mktemp P((char*)); /* traditional */
- X#else
- X char *tmpnam P((char*));
- X#endif
- X#if has_vfprintf
- X int vfprintf P((FILE*,char const*,va_list));
- X#else
- X#if has__doprintf
- X void _doprintf P((FILE*,char const*,va_list)); /* Minix */
- X#else
- X void _doprnt P((char const*,va_list,FILE*)); /* BSD */
- X#endif
- X#endif
- X
- X/* <stdlib.h> */
- char *getenv P((char const*));
- exiting void _exit P((int));
- exiting void exit P((int));
- malloc_type malloc P((size_t));
- malloc_type realloc P((malloc_type,size_t));
- void free P((malloc_type));
- X#ifndef EXIT_FAILURE
- X# define EXIT_FAILURE 1
- X#endif
- X#ifndef EXIT_SUCCESS
- X# define EXIT_SUCCESS 0
- X#endif
- X#if !has_fork && !has_spawn
- X int system P((char const*));
- X#endif
- X
- X/* <string.h> */
- char *strcpy P((char*,char const*));
- char *strchr P((char const*,int));
- char *strrchr P((char const*,int));
- int memcmp P((void const*,void const*,size_t));
- int strcmp P((char const*,char const*));
- size_t strlen P((char const*));
- void *memcpy P((void*,void const*,size_t));
- X#if has_memmove
- X void *memmove P((void*,void const*,size_t));
- X#endif
- X
- X/* <time.h> */
- time_t time P((time_t*));
- END_OF_FILE
- if test 14899 -ne `wc -c <'src/conf.heg'`; then
- echo shar: \"'src/conf.heg'\" unpacked with wrong size!
- fi
- # end of 'src/conf.heg'
- fi
- if test -f 'src/rcsgen.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'src/rcsgen.c'\"
- else
- echo shar: Extracting \"'src/rcsgen.c'\" \(11606 characters\)
- sed "s/^X//" >'src/rcsgen.c' <<'END_OF_FILE'
- X/*
- X * RCS revision generation
- X */
- X
- X/* Copyright (C) 1982, 1988, 1989 Walter Tichy
- X Copyright 1990, 1991 by Paul Eggert
- X Distributed under license by the Free Software Foundation, Inc.
- X
- This file is part of RCS.
- X
- RCS is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
- X
- RCS is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
- X
- You should have received a copy of the GNU General Public License
- along with RCS; see the file COPYING. If not, write to
- the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- X
- Report problems and direct all questions to:
- X
- X rcs-bugs@cs.purdue.edu
- X
- X*/
- X
- X
- X
- X/* $Log: rcsgen.c,v $
- X * Revision 5.10 1991/10/07 17:32:46 eggert
- X * Fix log bugs, e.g. ci -t/dev/null when has_mmap.
- X *
- X * Revision 5.9 1991/09/10 22:15:46 eggert
- X * Fix test for redirected stdin.
- X *
- X * Revision 5.8 1991/08/19 03:13:55 eggert
- X * Add piece tables. Tune.
- X *
- X * Revision 5.7 1991/04/21 11:58:24 eggert
- X * Add MS-DOS support.
- X *
- X * Revision 5.6 1990/12/27 19:54:26 eggert
- X * Fix bug: rcs -t inserted \n, making RCS file grow.
- X *
- X * Revision 5.5 1990/12/04 05:18:45 eggert
- X * Use -I for prompts and -q for diagnostics.
- X *
- X * Revision 5.4 1990/11/01 05:03:47 eggert
- X * Add -I and new -t behavior. Permit arbitrary data in logs.
- X *
- X * Revision 5.3 1990/09/21 06:12:43 hammer
- X * made putdesc() treat stdin the same whether or not it was from a terminal
- X * by making it recognize that a single '.' was then end of the
- X * description always
- X *
- X * Revision 5.2 1990/09/04 08:02:25 eggert
- X * Fix `co -p1.1 -ko' bug. Standardize yes-or-no procedure.
- X *
- X * Revision 5.1 1990/08/29 07:14:01 eggert
- X * Clean old log messages too.
- X *
- X * Revision 5.0 1990/08/22 08:12:52 eggert
- X * Remove compile-time limits; use malloc instead.
- X * Ansify and Posixate.
- X *
- X * Revision 4.7 89/05/01 15:12:49 narten
- X * changed copyright header to reflect current distribution rules
- X *
- X * Revision 4.6 88/08/28 14:59:10 eggert
- X * Shrink stdio code size; allow cc -R; remove lint; isatty() -> ttystdin()
- X *
- X * Revision 4.5 87/12/18 11:43:25 narten
- X * additional lint cleanups, and a bug fix from the 4.3BSD version that
- X * keeps "ci" from sticking a '\377' into the description if you run it
- X * with a zero-length file as the description. (Guy Harris)
- X *
- X * Revision 4.4 87/10/18 10:35:10 narten
- X * Updating version numbers. Changes relative to 1.1 actually relative to
- X * 4.2
- X *
- X * Revision 1.3 87/09/24 13:59:51 narten
- X * Sources now pass through lint (if you ignore printf/sprintf/fprintf
- X * warnings)
- X *
- X * Revision 1.2 87/03/27 14:22:27 jenkins
- X * Port to suns
- X *
- X * Revision 4.2 83/12/02 23:01:39 wft
- X * merged 4.1 and 3.3.1.1 (clearerr(stdin)).
- X *
- X * Revision 4.1 83/05/10 16:03:33 wft
- X * Changed putamin() to abort if trying to reread redirected stdin.
- X * Fixed getdesc() to output a prompt on initial newline.
- X *
- X * Revision 3.3.1.1 83/10/19 04:21:51 lepreau
- X * Added clearerr(stdin) for re-reading description from stdin.
- X *
- X * Revision 3.3 82/11/28 21:36:49 wft
- X * 4.2 prerelease
- X *
- X * Revision 3.3 82/11/28 21:36:49 wft
- X * Replaced ferror() followed by fclose() with ffclose().
- X * Putdesc() now suppresses the prompts if stdin
- X * is not a terminal. A pointer to the current log message is now
- X * inserted into the corresponding delta, rather than leaving it in a
- X * global variable.
- X *
- X * Revision 3.2 82/10/18 21:11:26 wft
- X * I added checks for write errors during editing, and improved
- X * the prompt on putdesc().
- X *
- X * Revision 3.1 82/10/13 15:55:09 wft
- X * corrected type of variables assigned to by getc (char --> int)
- X */
- X
- X
- X
- X
- X#include "rcsbase.h"
- X
- libId(genId, "$Id: rcsgen.c,v 5.10 1991/10/07 17:32:46 eggert Exp $")
- X
- int interactiveflag; /* Should we act as if stdin is a tty? */
- struct buf curlogbuf; /* buffer for current log message */
- X
- enum stringwork { enter, copy, edit, expand, edit_expand };
- static void scandeltatext P((struct hshentry*,enum stringwork,int));
- X
- X
- X
- X
- X char const *
- buildrevision(deltas, target, outfile, expandflag)
- X struct hshentries const *deltas;
- X struct hshentry *target;
- X FILE *outfile;
- X int expandflag;
- X/* Function: Generates the revision given by target
- X * by retrieving all deltas given by parameter deltas and combining them.
- X * If outfile is set, the revision is output to it,
- X * otherwise written into a temporary file.
- X * Temporary files are allocated by maketemp().
- X * if expandflag is set, keyword expansion is performed.
- X * Return nil if outfile is set, the name of the temporary file otherwise.
- X *
- X * Algorithm: Copy initial revision unchanged. Then edit all revisions but
- X * the last one into it, alternating input and output files (resultfile and
- X * editfile). The last revision is then edited in, performing simultaneous
- X * keyword substitution (this saves one extra pass).
- X * All this simplifies if only one revision needs to be generated,
- X * or no keyword expansion is necessary, or if output goes to stdout.
- X */
- X{
- X if (deltas->first == target) {
- X /* only latest revision to generate */
- X openfcopy(outfile);
- X scandeltatext(target, expandflag?expand:copy, true);
- X if (outfile)
- X return 0;
- X else {
- X Ozclose(&fcopy);
- X return(resultfile);
- X }
- X } else {
- X /* several revisions to generate */
- X /* Get initial revision without keyword expansion. */
- X scandeltatext(deltas->first, enter, false);
- X while ((deltas=deltas->rest)->rest) {
- X /* do all deltas except last one */
- X scandeltatext(deltas->first, edit, false);
- X }
- X if (expandflag || outfile) {
- X /* first, get to beginning of file*/
- X finishedit((struct hshentry *)nil, outfile, false);
- X }
- X scandeltatext(deltas->first, expandflag?edit_expand:edit, true);
- X finishedit(
- X expandflag ? deltas->first : (struct hshentry*)nil,
- X outfile, true
- X );
- X if (outfile)
- X return 0;
- X Ozclose(&fcopy);
- X return resultfile;
- X }
- X}
- X
- X
- X
- X static void
- scandeltatext(delta, func, needlog)
- X struct hshentry * delta;
- X enum stringwork func;
- X int needlog;
- X/* Function: Scans delta text nodes up to and including the one given
- X * by delta. For the one given by delta, the log message is saved into
- X * delta->log if needlog is set; func specifies how to handle the text.
- X * Assumes the initial lexeme must be read in first.
- X * Does not advance nexttok after it is finished.
- X */
- X{
- X struct hshentry const *nextdelta;
- X struct cbuf cb;
- X
- X for (;;) {
- X if (eoflex())
- X fatserror("can't find delta for revision %s", delta->num);
- X nextlex();
- X if (!(nextdelta=getnum())) {
- X fatserror("delta number corrupted");
- X }
- X getkeystring(Klog);
- X if (needlog && delta==nextdelta) {
- X cb = savestring(&curlogbuf);
- X delta->log = cleanlogmsg(curlogbuf.string, cb.size);
- X } else {readstring();
- X }
- X nextlex();
- X while (nexttok==ID && strcmp(NextString,Ktext)!=0)
- X ignorephrase();
- X getkeystring(Ktext);
- X
- X if (delta==nextdelta)
- X break;
- X readstring(); /* skip over it */
- X
- X }
- X switch (func) {
- X case enter: enterstring(); break;
- X case copy: copystring(); break;
- X case expand: xpandstring(delta); break;
- X case edit: editstring((struct hshentry *)nil); break;
- X case edit_expand: editstring(delta); break;
- X }
- X}
- X
- X struct cbuf
- cleanlogmsg(m, s)
- X char *m;
- X size_t s;
- X{
- X register char *t = m;
- X register char const *f = t;
- X struct cbuf r;
- X while (s) {
- X --s;
- X if ((*t++ = *f++) == '\n')
- X while (m < --t)
- X if (t[-1]!=' ' && t[-1]!='\t') {
- X *t++ = '\n';
- X break;
- X }
- X }
- X while (m < t && (t[-1]==' ' || t[-1]=='\t' || t[-1]=='\n'))
- X --t;
- X r.string = m;
- X r.size = t - m;
- X return r;
- X}
- X
- X
- int ttystdin()
- X{
- X static int initialized;
- X if (!initialized) {
- X if (!interactiveflag)
- X interactiveflag = isatty(STDIN_FILENO);
- X initialized = true;
- X }
- X return interactiveflag;
- X}
- X
- X int
- getcstdin()
- X{
- X register FILE *in;
- X register int c;
- X
- X in = stdin;
- X if (feof(in) && ttystdin())
- X clearerr(in);
- X c = getc(in);
- X if (c < 0) {
- X testIerror(in);
- X if (feof(in) && ttystdin())
- X afputc('\n',stderr);
- X }
- X return c;
- X}
- X
- X#if has_prototypes
- X int
- yesorno(int default_answer, char const *question, ...)
- X#else
- X /*VARARGS2*/ int
- X yesorno(default_answer, question, va_alist)
- X int default_answer; char const *question; va_dcl
- X#endif
- X{
- X va_list args;
- X register int c, r;
- X if (!quietflag && ttystdin()) {
- X oflush();
- X vararg_start(args, question);
- X fvfprintf(stderr, question, args);
- X va_end(args);
- X eflush();
- X r = c = getcstdin();
- X while (c!='\n' && !feof(stdin))
- X c = getcstdin();
- X if (r=='y' || r=='Y')
- X return true;
- X if (r=='n' || r=='N')
- X return false;
- X }
- X return default_answer;
- X}
- X
- X
- X void
- putdesc(textflag, textfile)
- X int textflag;
- X char *textfile;
- X/* Function: puts the descriptive text into file frewrite.
- X * if finptr && !textflag, the text is copied from the old description.
- X * Otherwise, if the textfile!=nil, the text is read from that
- X * file, or from stdin, if textfile==nil.
- X * A textfile with a leading '-' is treated as a string, not a file name.
- X * If finptr, the old descriptive text is discarded.
- X * Always clears foutptr.
- X */
- X{
- X static struct buf desc;
- X static struct cbuf desclean;
- X
- X register FILE *txt;
- X register int c;
- X register FILE * frew;
- X register char *p;
- X register size_t s;
- X char const *plim;
- X
- X frew = frewrite;
- X if (finptr && !textflag) {
- X /* copy old description */
- X aprintf(frew, "\n\n%s%c", Kdesc, nextc);
- X foutptr = frewrite;
- X getdesc(false);
- X foutptr = 0;
- X } else {
- X foutptr = 0;
- X /* get new description */
- X if (finptr) {
- X /*skip old description*/
- X getdesc(false);
- X }
- X aprintf(frew,"\n\n%s\n%c",Kdesc,SDELIM);
- X if (!textfile)
- X desclean = getsstdin(
- X "t-", "description",
- X "NOTE: This is NOT the log message!\n", &desc
- X );
- X else if (!desclean.string) {
- X if (*textfile == '-') {
- X p = textfile + 1;
- X s = strlen(p);
- X } else {
- X if (!(txt = fopen(textfile, "r")))
- X efaterror(textfile);
- X bufalloc(&desc, 1);
- X p = desc.string;
- X plim = p + desc.size;
- X for (;;) {
- X if ((c=getc(txt)) < 0) {
- X testIerror(txt);
- X if (feof(txt))
- X break;
- X }
- X if (plim <= p)
- X p = bufenlarge(&desc, &plim);
- X *p++ = c;
- X }
- X if (fclose(txt) != 0)
- X Ierror();
- X s = p - desc.string;
- X p = desc.string;
- X }
- X desclean = cleanlogmsg(p, s);
- X }
- X putstring(frew, false, desclean, true);
- X aputc('\n', frew);
- X }
- X}
- X
- X struct cbuf
- getsstdin(option, name, note, buf)
- X char const *option, *name, *note;
- X struct buf *buf;
- X{
- X register int c;
- X register char *p;
- X register size_t i;
- X register int tty = ttystdin();
- X
- X if (tty)
- X aprintf(stderr,
- X "enter %s, terminated with single '.' or end of file:\n%s>> ",
- X name, note
- X );
- X else if (feof(stdin))
- X faterror("can't reread redirected stdin for %s; use -%s<%s>",
- X name, option, name
- X );
- X
- X for (
- X i = 0, p = 0;
- X c = getcstdin(), !feof(stdin);
- X bufrealloc(buf, i+1), p = buf->string, p[i++] = c
- X )
- X if (c == '\n')
- X if (i && p[i-1]=='.' && (i==1 || p[i-2]=='\n')) {
- X /* Remove trailing '.'. */
- X --i;
- X break;
- X } else if (tty)
- X aputs(">> ", stderr);
- X return cleanlogmsg(p, i);
- X}
- END_OF_FILE
- if test 11606 -ne `wc -c <'src/rcsgen.c'`; then
- echo shar: \"'src/rcsgen.c'\" unpacked with wrong size!
- fi
- # end of 'src/rcsgen.c'
- fi
- echo shar: End of archive 3 \(of 11\).
- cp /dev/null ark3isdone
- MISSING=""
- for I in 1 2 3 4 5 6 7 8 9 10 11 ; do
- if test ! -f ark${I}isdone ; then
- MISSING="${MISSING} ${I}"
- fi
- done
- if test "${MISSING}" = "" ; then
- echo You have unpacked all 11 archives.
- rm -f ark[1-9]isdone ark[1-9][0-9]isdone
- else
- echo You still need to unpack the following archives:
- echo " " ${MISSING}
- fi
- ## End of shell archive.
- exit 0
-